﻿using Bootstrap.DataAccess;
using Bootstrap.DataAccess.Model;
using Bootstrap.Security;
using Longbow.Web.Mvc;
using System;
using System.Linq;

namespace Bootstrap.Admin.Query
{
    /// <summary>
    /// 通话明细
    /// </summary>
    public class QueryCallDetailsOption : PaginationOption
    {
        /// <summary>
        /// 主叫
        /// </summary>
        public string CallerID { get; set; } 

        /// <summary>
        /// 被叫
        /// </summary>
        public string CalleeID { get; set; }
        /// <summary>
        /// 开始日期
        /// </summary>
        public DateTime? BeginDate { get; set; }

        /// <summary>
        /// 结束日期
        /// </summary>
        public DateTime? EndDate { get; set; }
        /// <summary>
        /// 座席
        /// </summary>
        public string AgentNo { get; set; }

        /// <summary>
        /// 呼叫方向
        /// </summary>
        public string CallDir { get; set; }


        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public QueryData<CallDetails> RetrieveData()
        {
            var data = CallDetailsHelper.RetrievePages(this, BeginDate, EndDate,CallerID,CalleeID,AgentNo,CallDir);
            var ret = new QueryData<CallDetails>();
            ret.total = data.TotalItems;
            ret.rows = data.Items;
            return ret;
        }

       
    }
}
